﻿namespace Sai.Core
{
	using Sai.Core.Introspection;

	public class TypeDifferenceFactory : ITypeDifferenceFactory
	{
		private ApplicationVersionStamp avs = new ApplicationVersionStamp();

        public ITypeDifference Create(ITypeDeclaration declaration, IProductReleaseProject project)
		{ 
			return new TypeDifference()
				{
					Name = declaration.TypeName.Name,
                    NamespaceName = declaration.TypeName.Namespace,
                    SourceDefinition = declaration.ToCode(),
                    ProductName = this.avs.Name,
					ProductLink = this.avs.Link,
					ProductVersion = this.avs.Version,
                    ReportOnAdditions = project.ReportOnAdditions,
                    ReportOnChanges = project.ReportOnChanges,
                    ReportOnObsolete = project.ReportOnObsolete,
                    ReportOnRemovals = project.ReportOnRemovals
				};
		}
	}
}
